<#-- @ftlvariable name="widgetInstance" type="com.fable.sp.core.domain.WidgetInstance" -->
<#assign east>
    <@ui.panel title="操作">
    <button class="btn btn-sm btn-info" id="addWidget">从暂存中添加</button>
    <button class="btn btn-sm btn-info disabled" id="removeWidget">移除至暂存</button>
    <button class="btn btn-sm btn-info disabled" id="editWidget">编辑属性</button>
    <a class="btn btn-sm" aria-label="预览" href="<@spring.url relativeUrl="/sp/preview?layoutId=${layout.id}"/>" target="_blank">
        <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
    </a>
    </@ui.panel>
</#assign>

<@ui.control east=east activeStep=1>
${renderedLayout}
    <@ui.widgetScript/>
<script>
    $(function () {
        var modal = SP.modal({
            title: "暂存实例",
            url: '<@spring.url relativeUrl='/sp/widgets'/>?layoutId=${RequestParameters.layoutId}&instance=true&hideWidget=true',
            width: '900px',
            height: '500px'
        });
        $("#addWidget").click(function () {
            modal.modal("show");
        });
        $(".removeWidget").click(function () {

        });
    });

</script>
</@ui.control>